package day03.note;

import java.util.Random;
import java.util.Scanner;

public class txt9 {
    public static void main(String[] args) {
        Random r=new Random();

        int ranNum=r.nextInt(30);
        System.out.println(ranNum);

        Scanner s=new Scanner(System.in);

        int answer=s.nextInt();
       while (answer!=ranNum){
           System.out.println(answer>ranNum?"猜大了":"猜小了");
           answer=s.nextInt();
       }
        System.out.println("猜对了");

    }
}



// while (answer!=ranNum){
//            if (answer>ranNum){
//                System.out.println("猜大了");
//            }else {
//                System.out.println("猜小了");
//            }
//            answer=s.nextInt();
//            if (answer==ranNum){
//                System.out.println("猜对了");
//            }
//        }